package cn.fl.settlement.transform;

import cn.fl.capital.dto.CapCstStmScheduleDTO;
import cn.fl.settlement.vo.CapCstStmScheduleVO;
import cn.cmm.base.framework.utils.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @Description:  转换器
 * @Description: VO是客户端传递数据到服务端进行转换的数据
 * @Description: VO转换数据变成DTO传递到服务端
 * @Description: VO不能在服务端出现
 * Created by judahan on 2019/4/19.
 */
public class CapCstStmScheduleVOTransform {

    /**
     * DTO 转  VO
     * @param dto CapCstStmScheduleDTO
     * @return CapCstStmScheduleVO
     */
    public static CapCstStmScheduleVO toVO(CapCstStmScheduleDTO dto) {
        CapCstStmScheduleVO  vo = null;
        if (dto != null) {
            vo = new CapCstStmScheduleVO();
            vo.setScheduleCd(dto.getScheduleCd());
            vo.setScheduleNm(dto.getScheduleNm());
            vo.setCompleteTime(dto.getCompleteTime());
        }
        return vo;
    }

    /**
     * DTO集合 转 VO集合
     * @param list<CapCstStmApplyDTO>
     * @return List<CapCstStmApplyVO>
     */
    public static List<CapCstStmScheduleVO> toVOList(List<CapCstStmScheduleDTO> list) {
        List<CapCstStmScheduleVO>  voList = new ArrayList<CapCstStmScheduleVO>();
        if(CollectionUtils.isNotEmpty(list)){
            for (CapCstStmScheduleDTO dto : list) {
                voList.add(toVO(dto));
            }
        }
        return voList;
    }
}
